Repository navigation
Use target sysconfig for platform-qualified stable-ABI suffixes - #5352
Conversation
8e2b3aa to
dfd04e8
Compare
|
Eli just lmk about PEP 739. |
dfd04e8 to
3c3a334
Compare
|
See #5193 which touches the same code and also bears on Python 3.15 support. I'm happy to help with issues here and I've been struggling to get the attention of a setuptools maintainer about Python 3.15 support. |
|
Thanks @jameshilliard, and @vfazio for the report. I've written up how this relates to #5193 in #5193 (comment). Short version: this lands first. It fixes a regression against released 3.15, it touches only It diverges only when sysconfig describes a target other than the running interpreter, which is the case being fixed. On scope: I agree with drawing the line where you've drawn it. The residual host-vs-target leaks you identified in your review of #5193 — The CI failures showing on the 3.10 through 3.14 jobs here were from a |
3c3a334 to
28b1988
Compare
Python 3.15 includes platform-qualified stable-ABI suffixes in EXTENSION_SUFFIXES. During cross-compilation, these describe the running interpreter rather than the target, which can leave extensions with filenames the target cannot import. Construct stable-ABI suffixes from target sysconfig data instead. Preserve the file extension from EXT_SUFFIX, select ABI3 or ABI3T using Py_GIL_DISABLED, and add SOABI_PLATFORM when available. Keep the no-argument helper API and use an unqualified suffix when the target platform is unavailable. Preserve Windows debug and unsupported-loader behavior, including Cygwin and HP-UX. Cover target suffixes, version-independent ABI3T selection, the fallback, and consistent filenames across build_ext and wheel builds, including --skip-build. Closes pypa#5351
28b1988 to
97b75e6
Compare
Reconciles with pypa#5352, which landed the target-sysconfig rewrite of get_abi3_suffix() in build_ext.py. The two changes are complementary -- pypa#5352 fixes the extension filename, this branch fixes the wheel tag -- so the only collisions are in tests. test_bdist_wheel.py: keep both imports; stable_abi_tag from here and get_abi3_suffix from pypa#5352. test_build_ext.py: git merges this file cleanly but leaves it broken. test_stable_abi_filename patched build_ext.EXTENSION_SUFFIXES, and pypa#5352 removed that import, so monkeypatch.setattr raised AttributeError on both parametrizations. Rather than drop the test (which would orphan the check_stable_abi helper and lose native coverage), drive it from the configured target: it now asserts abi3t on a free-threaded build and abi3 otherwise, which exercises the real code path instead of a simulated suffix list. pypa#5352's test_abi3_filename_cross already covers cross-build naming for both ABIs, so the simulated suffix fixtures are redundant. Ref pypa#5193 (comment) Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Summary of changes
Python 3.15 includes platform-qualified stable-ABI suffixes in
EXTENSION_SUFFIXES. During cross-compilation, these describe the running interpreter rather than the target, which can leave extensions with filenames the target cannot import.Construct stable-ABI suffixes from target sysconfig data instead of the running interpreter's
EXTENSION_SUFFIXES. Preserve the file extension fromEXT_SUFFIX, select ABI3 or ABI3T usingPy_GIL_DISABLED, and add the platform qualifier fromSOABI_PLATFORMwhen available. Keep the helper's no-argument API and fall back to an unqualified suffix when the target platform is unavailable.Add regression tests covering target suffixes, version-independent ABI3T selection, preservation of the file extension, the fallback, Windows, Cygwin, HP-UX, and consistent filenames across
build_extand wheel builds, including--skip-build.Closes #5351
Testing
test_build_ext.pyandtest_bdist_wheel.py.test_build_ext.py,test_bdist_wheel.py, and mypy.git diff --check, passed.Pull Request Checklist
newsfragments/. (See documentation for details)